// 测试响应头的JavaScript脚本
async function testHeaders() {
    try {
        const response = await fetch('http://localhost:8081/api/login', {
            method: 'POST',
            headers: {
                'Content-Type': 'application/json',
                'X-Encrypted': 'true'
            },
            body: JSON.stringify({
                encrypted: 'kDkpdApTiFjVO4I9UdBM646+e0BGFGV6JIFnIxoywNcrYWkzZdZzmODFw+L+jvzB'
            })
        });

        console.log('Response status:', response.status);
        console.log('Response headers:');
        for (let [key, value] of response.headers.entries()) {
            console.log(`  ${key}: ${value}`);
        }
        
        const data = await response.text();
        console.log('Response body:', data);
        
    } catch (error) {
        console.error('Error:', error);
    }
}

testHeaders();
